In computing, the focus indicates the component of the graphical user interface which is selected to receive input. Text entered at the keyboard or pasted from a clipboard is sent to the component which has the focus. Moving the focus away from a specific user interface element is known as a blur event in relation to this element. Typically, the focus is withdrawn from an element by giving another element the focus. This means that focus and blur events typically both occur virtually simultaneously, but in relation to different user interface elements, one that gets the focus and one that gets blurred (source: Wikipedia).
In other words, object focus is by its nature an exclusive property of a GUI object—only a single component within components hierarchy may be focused.
In this context there is typically applied a boolean property called “focused” that indicates a focused object, usually complemented with additional boolean property called “has focus”. The object having the “focused” property set to true is the exclusively focused object in the objects hierarchy. The “has focus” property is different from “focused” property in that if “has focus” is true it means that a given object or one of his descendants is focused. There is a chain of “has focus”-ed objects till an object that has “is focused” set to true is reached.
This approach is used in so-called event capturing or bubbling techniques.
The main principle of bubbling is that after an event triggers on the deepest possible element, it then triggers on parents in nesting order. The bubbling goes to the top of objects hierarchy. When an event occurs on an object, it will bubble up to the parent object, triggering appropriate handlers. In any case a handler may decide that event is fully processed and stop the bubbling.
In turn capturing is opposite to bubbling and starts at the top object in the hierarchy in order to propagate downwards in the hierarchy structure of the objects tree.
A known prior art patent publication of U.S. Pat. No. 8,347,215 B2 entitled “Simultaneous input across multiple applications” discloses that one or more users may interact simultaneously with different applications on the same device through an input system such as a touch-sensitive display screen. Simultaneous user input may be detected by a multiple input system and subsequently transmitted to an application using a single transmission frame. An application corresponding to the user input is determined based on an input location of the user input and a location and size of a corresponding application. Simultaneous user inputs are rendered simultaneously by each corresponding application. Each application may further include a secondary event processing thread that runs in parallel to traditional operating system event threads. The secondary event processing thread bypasses sequential processing limits of an operating system event thread, providing substantially simultaneous processing of input.
A drawback of this solution is that different focus managers must be employed. Another disadvantage is that a special secondary event processing thread that bypasses typical event propagation architecture must be applied. Hence it is a significant interference with the legacy systems. Further there is a separate event distribution manager and multithreaded event processing, which is very resource consuming, for example in terms of subsequent resources synchronization.
Another prior art publication of EP0368779 B1 entitled “Method for concurrent data entry and manipulation in multiple applications” discloses methods for inputting common data into a plurality of computer application programs and in particular to methods for automatically and concurrently entering common data into a plurality of computer application programs. Still more particularly, this invention relates to methods which permit the concurrent manipulation of common data which is present within a plurality of computer application programs.
A drawback of this solution is that a special action must be performed by a user on several components and that all the selected components must act in the same manner.
It is sometimes needed to have more than one component that is in focus and may receive events such as keyboard keystrokes notifications. Another advantage of multi focus system is that a single application may run a plurality of submodules that may be unrelated to each other.
Therefore, there exists a problem of efficient implementation of a multi focus system in a software application.
It would be thus desirable to provide an improved method for managing multi focus in a software application.